package com.zmm.study.order.controller;

import com.zmm.common.base.model.Result;
import com.zmm.common.base.model.ResultCode;
import com.zmm.study.order.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 900045
 * @description:
 * @name OrderFinishController
 * @date By 2021-10-21 11:53:02
 */
@Slf4j
@RestController
@RequestMapping("/order")
public class OrderFinishController {
	
	@Resource
	private OrderService orderService;

	/**
	 * 测试 -- 订单支付完成
	 * @author: 900045
	 * @date: 2021-10-21 14:22:36
	 * @throws 
	 * @param orderNo: 
	 * @return: com.zmm.common.base.model.Result
	 **/
	@GetMapping("/test/finish/order")
	public Result finishOrderTest(String orderNo){
		orderService.finishOrder(orderNo);
		orderService.discountStock(orderNo);
		return Result.ok(ResultCode.SUCCESS);
	}
}
